home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / land.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  3.1 KB  |  89 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Land --- create a pattern that resembles a Topographic map
  4. ; Copyright (C) 1997 Adrian Karstan Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ;      This script works on the current gradient you have loaded. 
  8. ;      Some suggested gradients: 
  9. ;            Land                  (produces a earthlike map)
  10. ;            Brushed_aluminum      (looks like the moon)
  11. ;  
  12. ;
  13. ; Thanks to Quartic for helping me debug this thing. 
  14. ;
  15. ; This program is free software; you can redistribute it and/or modify
  16. ; it under the terms of the GNU General Public License as published by
  17. ; the Free Software Foundation; either version 2 of the License, or
  18. ; (at your option) any later version.
  19. ; This program is distributed in the hope that it will be useful,
  20. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ; GNU General Public License for more details.
  23. ; You should have received a copy of the GNU General Public License
  24. ; along with this program; if not, write to the Free Software
  25. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27.  
  28.  
  29. (define (script-fu-land width height seed detail landheight seadepth xscale yscale gradient)
  30.   (let* (
  31.      (img (car (gimp-image-new width height RGB)))
  32.      (layer-one (car (gimp-layer-new img width height
  33.                      RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
  34.      (layer-two)
  35.     )
  36.   (gimp-context-set-gradient gradient)
  37.   (gimp-image-undo-disable img)
  38.   (gimp-image-add-layer img layer-one 0)
  39.  
  40.   (plug-in-solid-noise 1 img layer-one TRUE FALSE seed detail xscale yscale)
  41.   (plug-in-c-astretch 1 img layer-one)
  42.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  43.   (gimp-image-add-layer img layer-two -1)
  44.   (gimp-image-set-active-layer img layer-two)
  45.  
  46.   (plug-in-gradmap 1 img layer-two)
  47.  
  48.  
  49.  
  50.   (gimp-by-color-select layer-one '(190 190 190) 55 CHANNEL-OP-REPLACE FALSE FALSE 0 FALSE)
  51.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
  52.  
  53.   ;(plug-in-c-astretch 1 img layer-two)
  54.   (gimp-selection-invert img)
  55.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 seadepth 0 0 0 0 TRUE FALSE 0)
  56.  
  57.   ;(plug-in-c-astretch 1 img layer-two)
  58.  
  59.   ; uncomment the next line if you want to keep a selection of the "land"
  60.   (gimp-selection-none img)
  61.  
  62.   (gimp-display-new img)
  63.   (gimp-image-undo-enable img)
  64. ))
  65.  
  66. (script-fu-register "script-fu-land"
  67.             _"_Land..."
  68.             "A Topgraphic map pattern"
  69.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  70.             "Adrian Likins"
  71.             "1997"
  72.             ""
  73.             SF-ADJUSTMENT _"Image width"  '(256 10 1000 1 10 0 1)
  74.             SF-ADJUSTMENT _"Image height" '(256 10 1000 1 10 0 1)
  75.             SF-ADJUSTMENT _"Random seed"  '(32 0 15000000 1 10 0 1)
  76.             SF-ADJUSTMENT _"Detail level" '(4 1 15 1 5 0 0)
  77.             SF-ADJUSTMENT _"Land height"  '(60 1 65 1 10 0 1)
  78.             SF-ADJUSTMENT _"Sea depth"    '(4 1 65 1 10 0 1)
  79.             SF-ADJUSTMENT _"Scale X"      '(4 0.1 16 1 5 0.1 0)
  80.             SF-ADJUSTMENT _"Scale Y"      '(4 0.1 16 1 5 0.1 0)
  81.             SF-GRADIENT   _"Gradient"     "Land 1")
  82.  
  83. (script-fu-menu-register "script-fu-land"
  84.              _"<Toolbox>/Xtns/Script-Fu/Patterns")
  85.